package client.universe;

import java.util.ArrayList;
import java.util.Collection;

import javax.swing.JFrame;

import client.visualisator.*;

import client.object.PObject3D;

public class PSharedUniverseImpl implements PSharedUniverse {

	private Collection<PObject3D> objectsPresentations;
	private UniverseVisualisator visualisator;
	
	public PSharedUniverseImpl() {
		objectsPresentations = new ArrayList<PObject3D>();
		
		visualisator = new UniverseVisualisator();

		visualisator.setBounds(20, 20, 400, 400);
		visualisator.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		visualisator.setVisible(true);	
	}
	
	@Override
	public void addObject(PObject3D objectPresentation) {
		objectsPresentations.add(objectPresentation);
		visualisator.addObject3D(objectPresentation);
	}

}
